<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Ajax</title>
    <script src="../day01/js/jquery-3.7.1.min.js"></script>
</head>
<body>
    <div></div>
</body>
<script>
    // Ajax特点：异步请求，局部更新

    // 请求方式：get post put delete head options trace

</script>
<!-- get -->
 <script>
    //Query参数：地址拼接
    // $.get(url地址，回调函数)
    // $.get("http://dummyimage.com/400x400/pet/{petId}",function(data){
    //     console.log(data);
    // })
    $.get("https://showme2.myhope365.com/online_course/weChat/applet/course/banner/list?number=4",function(response){
        console.log(response);
        if(response.code == 0){
            response.data.forEach(function(item) {
                $('div').append(` <div id="${item.imgUrl}"></div>`)
            });      
        }
    })
 </script>
</html>